package com.boss.fileapp.dao.impl;

import com.boss.fileapp.consts.TableName;
import com.boss.fileapp.dao.ISalaryBackLogDao;
import com.boss.fileapp.util.DateUtils;
import com.boss.framework.dao.BaseDaoImpl;
import com.boss.sys.utils.SysUtils;
import org.springframework.stereotype.Repository;


@Repository
public class SalaryBackLogDaoImpl  extends BaseDaoImpl implements ISalaryBackLogDao {
    @Override
    public void saveSalaryBackLog(String bankName, String bankCode, String log_type, String province) {
        StringBuilder sb = new StringBuilder();
        sb.append(" insert into ")
                .append(TableName.SALARY_BACK_LOG)
                .append(" (id, bank_code, bank_name, create_time, update_time, is_read, is_deleted, log_type, mof_div_code) ")
                .append(" values ");
                sb.append(" (?, ?, ?, ?, ?, ?, ?, ?, ?) ");

            Object[] params = new Object[]{
                    SysUtils.generateGuid(),bankCode,bankName, DateUtils.getCurrentTimeStr("yyyy-MM-dd HH:mm:ss")
                    , DateUtils.getCurrentTimeStr("yyyy-MM-dd HH:mm:ss"),0,0,log_type,province
            };


        this.getJdbcTemplate().update(sb.toString(), params);
    }
}
